import { http } from "@/utils/http";

// 登录
type result = {
  code: number;
  msg: string;
  token?: string;
  img?: string;
  captchaEnabled?: boolean;
  uuid?: string;
};
type LoginParams = {
  username: string;
  password: string;
  code?: string;
  uuid?: string;
};
export function login(data?: LoginParams): Promise<result> {
  return http.request({
    url: "/login",
    method: "post",
    data
  });
}
export function captchaImage(params?: object): Promise<result> {
  return http.request({
    url: "/captchaImage",
    method: "get",
    params
  });
}
